﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>EditView</title>
    <link href="~/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
<div style="width:800px">
    <form class="layui-form" action="/Payment/Update">
      <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
          <input type="text" id="Title" name="Title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">付款金额</label>
        <div class="layui-input-block">
          <input type="text" id="PaymentPrice" name="PaymentPrice" required  lay-verify="required" placeholder="请输入付款金额" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">结算方式</label>
        <div class="layui-input-block">
          <input type="radio" name="PaymentType" value="微信支付" title="微信支付">
          <input type="radio" name="PaymentType" value="支付宝支付" title="支付宝支付">
          <input type="radio" name="PaymentType" value="银联支付" title="银联支付">
          <input type="radio" name="PaymentType" value="企业转账" title="企业转账">
          <input type="radio" name="PaymentType" value="线下支付" title="线下支付">
          <input type="radio" name="PaymentType" value="其它" title="其它">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >支付对象</label>
        <div class="layui-input-block">
          <input type="text" id="PaymentObject" name="PaymentObject" required  lay-verify="required" placeholder="请输入支付对象" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >开户行</label>
        <div class="layui-input-block">
          <input type="text" id="Bank" name="Bank" required  lay-verify="required" placeholder="请输入开户行" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">银行账户</label>
        <div class="layui-input-block">
          <input type="text" id="BankAccount" name="BankAccount" required  lay-verify="required" placeholder="请输入银行账户" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">付款日期</label>
        <div class="layui-input-block">
          <input type="text" id="PaymentTime" name="PaymentTime" required  lay-verify="required" placeholder="请输入付款日期" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">用途描述</label>
        <div class="layui-input-block">
          <input type="text" id="PurposePescription" name="PurposePescription" required  lay-verify="required" placeholder="请输入用途描述" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
          <textarea id="Remarks" name="Remarks" placeholder="请输入备注" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label"> 票据附件</label>
        <div class="layui-input-block">
            <div class="layui-upload-drag" id="test10">
              <i class="layui-icon">&#xe67c;</i>
              <p>点击上传，或将文件拖拽到此处</p>
            </div>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" type="submit" lay-submit >立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary" onclick="fh()">返回</button>
        </div>
      </div>
    </form>
</div>

    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/layui/layui.js"></script>
<script>
//Demo
$(function(){
    //文档就绪函数
    GetById();
})
layui.use('form', function(){
  var form = layui.form;
  form.render();
  //监听提交

  form.on('submit(formDemo)', function(data){
  });
});
function fh(){
    location.href="/Payment/Index";

}

    var id = @ViewBag.id;
        
        function GetById()
        {
            $.ajax({
                url:"/Payment/GetById?id="+id,
                type:"get",
                dataType:"json",
                success:function(obj){
                    $("#Id").val(obj.id);
                    $("#Title").val(obj.title);
                    $("#PurposePescription").val(obj.purposePescription);
                    $("#PaymentPrice").val(obj.paymentPrice);
                    $("#PaymentType").val(obj.paymentType);
                    $("#PaymentObject").val(obj.paymentObject);
                    $("#Bank").val(obj.bank);
                    $("#BankAccount").val(obj.bankAccount);
                    $("#State").val(obj.state);
                    $("#Approver").val(obj.approver);
                    $("#PaymentTime").val(obj.paymentTime);
                    $("#Remarks").val(obj.remarks);
                }
            })
        }

</script>
</body>
</html>
